# -*- coding: utf-8 -*-
import KBEngine
from logic.engine.ExeFlowModule import ExeFlowModule
from logic_common.ContainerHandler import ContainerHandler
from logic.HallModule import HallModule
from logic.NameModule import NameModule

def Instance():
	return ModuleMgr.instance

# 调试看值来源
# KBEngine.entities[1].IKernel.moduleMgr.allModule

class ModuleMgr:
	instance = None

	def __init__(self):
		ModuleMgr.instance = self

		self.allModule = {
			"ExeFlowModule"			: ExeFlowModule(),# 专门用来监听引擎代理执行流程的模块
			"HallModule"			: HallModule(),
			"NameModule"			: NameModule(),
			"ContainerHandler"		: ContainerHandler(),
		}

	def init(self, isReload):
		for modName, modInst in self.allModule.items():
			modInst.init(isReload)

	def end(self):
		for modName, modInst in self.allModule.items():
			modInst.end()

	def getModule(self, moduleName):
		return self.allModule.get(moduleName)







































































































